package com.yanqu.road.entity.activity.commonwish;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.fanxiuspring.FanXiuSpringDrawInfo;
import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

public class CommonWishConfig {


    private List<CommonWishDrawInfo> drawInfoList;

    private ActivityInfo activityInfo;


    public boolean afterInit(){

        if(!StringUtils.isNullOrEmpty(getDrawRarePool())) {
            List<String> itemList = new ArrayList<>();
            List<Integer> timesList = new ArrayList<>();
            List<String> poolStrList = StringUtils.stringToStringList(getDrawRarePool(), "\\|");
            for (String str : poolStrList) {
                List<String> paramList = StringUtils.stringToStringList(str, ";");
                itemList.add(paramList.get(0));
                timesList.add(Integer.parseInt(paramList.get(1)));
            }
            if (itemList.size() == 0 || timesList.size() == 0) {
                return false;
            }
            this.poolItemList = itemList;
            this.poolTimesList = timesList;

        }

        return true;
    }

    public int getBigRewardWeight(int oppVal){
        int weight = 0;
        List<String> rangleList = StringUtils.stringToStringList(drawRareWeight, "\\|");
        for (String s : rangleList) {
            List<Integer> list = StringUtils.stringToIntegerList(s, ";");
            if(oppVal >= list.get(0)){
                weight = list.get(1);
            }
        }

        return weight;
    }

    private int piceItemId;

    private int scoreItemId;

    private int tenDrawScoreLimit;

    private int drawScoreGet;

    private int drawOppAdd;

    private int drawOppMax;

    private String drawRarePool;

    private List<String> poolItemList = new ArrayList<>();
    private List<Integer> poolTimesList = new ArrayList<>();

    private String drawRareWeight;

    private int drawNoticeCount;

    private int drawItemId;

    //银月信物回收奖励
    private String itemRecycle;

    private int quickUseNum;

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }

    public List<CommonWishDrawInfo> getDrawInfoList() {
        return drawInfoList;
    }

    public void setDrawInfoList(List<CommonWishDrawInfo> drawInfoList) {
        this.drawInfoList = drawInfoList;
    }

    public int getPiceItemId() {
        return piceItemId;
    }

    public void setPiceItemId(int piceItemId) {
        this.piceItemId = piceItemId;
    }

    public int getScoreItemId() {
        return scoreItemId;
    }

    public void setScoreItemId(int scoreItemId) {
        this.scoreItemId = scoreItemId;
    }

    public int getTenDrawScoreLimit() {
        return tenDrawScoreLimit;
    }

    public void setTenDrawScoreLimit(int tenDrawScoreLimit) {
        this.tenDrawScoreLimit = tenDrawScoreLimit;
    }

    public int getDrawScoreGet() {
        return drawScoreGet;
    }

    public void setDrawScoreGet(int drawScoreGet) {
        this.drawScoreGet = drawScoreGet;
    }

    public int getDrawOppAdd() {
        return drawOppAdd;
    }

    public void setDrawOppAdd(int drawOppAdd) {
        this.drawOppAdd = drawOppAdd;
    }

    public int getDrawOppMax() {
        return drawOppMax;
    }

    public void setDrawOppMax(int drawOppMax) {
        this.drawOppMax = drawOppMax;
    }

    public String getDrawRarePool() {
        return drawRarePool;
    }

    public void setDrawRarePool(String drawRarePool) {
        this.drawRarePool = drawRarePool;
    }

    public String getDrawRareWeight() {
        return drawRareWeight;
    }

    public void setDrawRareWeight(String drawRareWeight) {
        this.drawRareWeight = drawRareWeight;
    }

    public int getDrawNoticeCount() {
        return drawNoticeCount;
    }

    public void setDrawNoticeCount(int drawNoticeCount) {
        this.drawNoticeCount = drawNoticeCount;
    }

    public void setActivityInfo(ActivityInfo activityInfo) {
        this.activityInfo = activityInfo;
    }

    public List<String> getPoolItemList() {
        return poolItemList;
    }

    public void setPoolItemList(List<String> poolItemList) {
        this.poolItemList = poolItemList;
    }

    public List<Integer> getPoolTimesList() {
        return poolTimesList;
    }

    public void setPoolTimesList(List<Integer> poolTimesList) {
        this.poolTimesList = poolTimesList;
    }

    public String getItemRecycle() {
        return itemRecycle;
    }

    public void setItemRecycle(String itemRecycle) {
        this.itemRecycle = itemRecycle;
    }

    public int getDrawItemId() {
        return drawItemId;
    }

    public void setDrawItemId(int drawItemId) {
        this.drawItemId = drawItemId;
    }

    public int getQuickUseNum() {
        return quickUseNum;
    }

    public void setQuickUseNum(int quickUseNum) {
        this.quickUseNum = quickUseNum;
    }
}
